package com.macro.mall.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.dto.PmsPortalProductDetail;
import com.macro.mall.service.UmsPortalProductService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：MinxiaoHao
 * @Description:
 * @name：PmsPortalProductController
 * @Date：2024/10/19 19:36
 */
@Controller
@RequestMapping("/product")
public class UmsPortalProductController {
    @Autowired
    private UmsPortalProductService portalProductService;

    /**
     * 获取前台商品详情
     * @param id
     * @return
     */
    @ApiOperation("获取前台商品详情")
    @GetMapping(value = "/detail/{id}")
    @ResponseBody
    public CommonResult<PmsPortalProductDetail> detail(@PathVariable Long id) {
        PmsPortalProductDetail productDetail = portalProductService.detail(id);
        return CommonResult.success(productDetail);
    }
}
